home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6673 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: dispatch.news.demon.net!demon!gw-pc.industry.ivab.se
  2. From: Goran Wireen <Goran_Wireen@ivab.se>
  3. Newsgroups: comp.lang.c
  4. Subject: Is it possible to have one Makefile for several compilers?
  5. Date: Fri, 16 Feb 1996 15:23:31 +0100
  6. Message-ID: <31249363.1664@ivab.se>
  7. NNTP-Posting-Host: gw-pc.industry.ivab.se
  8. X-NNTP-Posting-Host: gw-pc.industry.ivab.se
  9. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  10. MIME-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13.  
  14. I would like to use the same Makefile for different compilers 
  15. (Gnu C/C++, Unix cc, CXX). I was hoping that I easily could 
  16. select compiler by calling e.g:
  17.  
  18.   make gcc all
  19.  
  20. and by using a Makefile that looks something like this:
  21.  
  22.   # Default compiler is cc
  23.   CC = cc
  24.  
  25.   cxx:
  26.     CC = cxx
  27.  
  28.   gcc:
  29.     CC = gcc
  30.  
  31.   all:
  32.     $(CC) $(CFLAGS_AND_STUFF) $(SOURCES) ...
  33.  
  34. But as you can assign macros in the command lines below cxx: and 
  35. gcc: this won't work.
  36.  
  37. Does anybody have any idea how I can select compiler in a simple 
  38. way?
  39.  
  40.  
  41. Email me at Goran_Wireen@ivab.se
  42.  
  43. /Goran Wireen, Combitech Innovativ Vision, Sweden
  44.